<pre>
from functools import wraps


class AuthClass:
    def __init__(self, name, pwd):
        self.name = name
        self.pwd = pwd

    def check_user(p):
        @wraps(p)
        def inner(user, *args, **kwargs):
            if(user.auth()):
                return p(user)
            else:
                print("认证失败！")
                return False
        return inner

    @check_user
    def func(user):
        return "认证成功，欢迎您~"

    info = input("请输入用户名和密码，用空格隔开：").split(" ")
    name = info[0]
    pwd = info[1]

    user1 = AuthClass(name, pwd)
    print(func(user1))

</pre>